define(['app','assets/js/jquery-weui'],function(app,weui){return {module: function($scope, $http, eventBusService, httpService, params) {
	httpService.post(app.urls.role_selectType,{},function(data){
		if("0000" === data.code){
			$scope.form.userrole = data.data[0].type;
		}else{
			alert(data.msg);
		}
	});
	$scope.mobileModeul = app.include("modules/mobile/district/analyse/school?back=''");
	
	$(".tabCon a").click(function() {
		 $(this).addClass("active").siblings().removeClass("active");
	});
	
	$scope.school=function(){
		var menu = {};
		menu.url = "modules/mobile/district/analyse/school?back=''";
		eventBusService.publish("modules.mobile.load",menu);
	}
	
	$scope.teacher=function(){
		var menu = {};
		if($scope.form.userrole>1){
			menu.url = "modules/mobile/school/analyse/teacher?back=''";
		}else{
			menu.url = "modules/mobile/district/analyse/teacher?back=''";
		}
		eventBusService.publish("modules.mobile.load",menu);
	}
	
	$scope.student=function(){
		var menu = {};
		if($scope.form.userrole>1){
			menu.url = "modules/mobile/school/analyse/student?back=''";
		}else{
			menu.url = "modules/mobile/district/analyse/student?back=''";
		}
		eventBusService.publish("modules.mobile.load",menu);
	}
	
	//接收模块变更
	eventBusService.subscribe('modules.mobile.load', function(event,data) {
		$scope.mobileModeul = app.include(data.url);
	});
}}});